home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / DOS.SWG / 0066_File There ??.pas < prev    next >
Pascal/Delphi Source File  |  1994-08-24  |  927b  |  22 lines

  1.  
  2. { Try the DOS GetAttr function (Also faster than findfirst) }
  3.  
  4.   { test to see if file exists }
  5.   function fIsFileP(SrcPath:pchar):boolean;
  6.   inline({get fattr, dos 2.0+}
  7.     $5A/                        { pop   dx             }
  8.     $58/                        { pop   ax             }
  9.     $1E/                        { push  ds             }
  10.     $8E/$D8/                    { mov   ds,ax          }
  11.     $B8/$00/$43/                { MOV   AX,4300h       }
  12.     $CD/$21/                    { int   21h            }
  13.     $1F/                        { pop   ds             }
  14.     $72/$08/                    { JC    +8             }
  15.     $B8/$01/$00/                { MOV   AX,1           }
  16.     $F6/$C1/$10/                { TEST  CL,faDirectory }
  17.     $74/$02/                    { JE    +2             }
  18.     $31/$C0);                   { xor   ax,ax          }
  19.  
  20. BEGIN
  21.   WriteLn(FisFIleP('\turbo\bp.exe'));
  22. END.